<template>
	<view class="agreement">
		<dwu-navbar bgColor="transparent" :title="title"></dwu-navbar>
		<image class="top-bg" src="@/static/agreement/top_bg.png" mode=""></image>
		<view class="content">
			<image class="bg" src="@/static/agreement/bg.png" mode=""></image>
			<rich-text style="position: relative;z-index: 10;" :nodes="content"></rich-text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '用户协议',
				content: ''
			};
		},
		onLoad(options) {
			let url = '/index/getUserAgreement'
			if (options.type == 'user') {
				this.title = '用户协议'
				url = '/index/getUserAgreement'
			}
			if (options.type == 'privacy') {
				this.title = '隐私政策'
				url = '/index/yszcindex'
			}
			if (options.type == 'handbook') {
				this.title = '操作手册'
				url = '/index/getaOperationManual'
			}
			this.getUserAgreement(url)
		},
		methods: {
			getUserAgreement(url) {
				this.request.http(url, 'post').then(res => {
					let data = res.data
					if (data.code == 1) {
						this.content = data.data
					}
				})
			}
		}
	}
</script>

<style lang="less">
	page {
		background: #F7F9F9;
	}

	.agreement {

		// padding: 30rpx;
		.top-bg {
			position: fixed;
			top: 0;
			left: 0;
			width: 100%;
			height: 882rpx;
			z-index: 1;
		}

		.content {
			padding: 40rpx;
			margin: 0 auto;
			position: relative;
			z-index: 10;
			width: 730rpx;
			min-height: calc(100vh - 200rpx);

			.bg {
				position: absolute;
				top: 0;
				left: 0;
				width: 100%;
				height: 100%;
				z-index: -1;
			}
			rich-text {
				position: relative;
				z-index: 10;
				* {
					position: relative;
					z-index: 10;
				}
			}
		}
	}
</style>